<?php

	$TEMP->set_file(array('handle' => DIR_IFRAME_VIEW . 'requestIrregularStudentSubject.html'));
	
	$studID = $_GET['id'];
	$tblid	= $_GET['tblid'];
	$tblr	= $_GET['tblr'];
	
	$strStudPictureName = $globalCon->getStudentPictureName($studID);
	$strName			= $strStudPictureName['name'];
	$strAccNo			= $strStudPictureName['stud_no'];
	$courseID			= $strStudPictureName['course_idPK'];
	$courseCode			= $strStudPictureName['course_code'];
	$courseDesc			= $strStudPictureName['course_desc'];
	
	$studentSection = $globalCon->getStudentSection($studID, $semLinkID, $activeYear);
	$sectionID		= $studentSection['section_idPK'];
	$sectionDesc	= $studentSection['section_desc'];
	$sectionSemID 	= $studentSection['stud_sem_idPK'];
	
	$studentRequestIrregularSubject = $STUD->getStudentRequestIrregularSubject($tblid);
	
	
	if ( isset($_POST['accept_status']) ) {
		$if_error	= 0;
		$acceptstatus = _POST('accept_status');
		if ( $acceptstatus == 'Y' ) {
			$STUD->deleteSubjEnrolled($studentRequestIrregularSubject['stud_subj_linker_idPK']);
		}
		$STUD->updateStudDropSubjIrreg($acceptstatus, $tblr, $tblid);
		$if_display = 1;
	}
	else {
		$if_display	 = 0;
		$if_error	 = 0;
		$_txtsection = '';
	}
	$TEMP->set_var(array('subject'		=> $studentRequestIrregularSubject['subj_desc'] . ' (' . $studentRequestIrregularSubject['subj_code'] . ')',
						 'course_label'	=> $courseDesc . ' (' . $courseCode . ')',
						 'sy_label'		=> $__SYR__,
						 'name'			=> $strName,
						 'if_display'	=> $if_display
						));

?>